package org.jground.rx.ui.zk.viewControl;

import org.jground.rx.IRXObject;
import org.jground.rx.RXView;
import org.jground.rx.ui.IUIAttribute;
import org.jground.rx.ui.zk.UIFrame;
import org.zkoss.zk.ui.Component;

public class UIAttributeForeach extends UIAttributeBase {

    public UIAttributeForeach() {
        super();
    }
    

    public IUIAttribute<Component,UIFrame> createNew(UIFrame uiFrame, RXView moView) {
        return new UIAttributeForeach(uiFrame, moView);
    }

    private UIAttributeForeach(UIFrame uiFrame, RXView moView) {
        super(uiFrame, moView);
        super.uiAttributeView = UIAttributeViewControlFactory.create(uiFrame, moView);
        super.addToControlComponent(uiAttributeView.getComponent());
    }
    //


    public  IRXObject updateData() {
        if(uiAttributeView instanceof UIAttributeControlForeach) {
            UIAttributeControlForeach ui = (UIAttributeControlForeach)uiAttributeView;
            ui.update();
        }
        return super.updateData();
    }


}
